﻿using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;

namespace Xmhouse.Passport
{
    /// <summary>
    /// 主站WEB服务
    /// 请对接口添加安全验证
    /// </summary>
    [WebService(Namespace = "http://passport.xmhouse.com/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    public class TokenService : System.Web.Services.WebService
    {
        /// <summary>
        /// 根据令牌获取用户凭证
        /// </summary>
        /// <param name="tokenValue">令牌</param>
        /// <returns></returns>
        [WebMethod]
        public object TokenGetCredence(string tokenValue)
        {
            CacheManager cm = new CacheManager();
            return cm.GetInfo(tokenValue);
        }

        /// <summary>
        /// 清除令牌
        /// </summary>
        /// <param name="tokenValue">令牌</param>
        [WebMethod]
        public void ClearToken(string tokenValue)
        {
            CacheManager cm = new CacheManager();
            cm.Clear(tokenValue);
        }

    }//end class
}
